package com.luwanglin.eduservice.servicetest;

import com.luwanglin.eduservice.entity.EduCourseDescription;
import com.luwanglin.eduservice.service.EduCourseDescriptionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author lwl
 */
@Service
public class MyserviceImpl implements Myservice {
    @Autowired
    EduCourseDescriptionService courseDescriptionService;

    @Transactional
    @Override
    public void test1(EduCourseDescription eduCourseDescription) {
        test2(eduCourseDescription);
    }

    @Override
    @Transactional
    public void test2(EduCourseDescription description) {
        courseDescriptionService.save(description);
        int i = 1 / 0;
        EduCourseDescription description1 = courseDescriptionService.getById(description.getId());
        System.out.println(description1);
    }
}
